package aptech.eproject.logictics.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the WAREHOUSE database table.
 * 
 */
@Embeddable
public class WarehousePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private int branchId;
	private int packageId;

    public WarehousePK() {
    }

    public WarehousePK(int branchId, int packageId) {
        this.branchId = branchId;
        this.packageId = packageId;
    }

    
	@Column(name="BRANCH_ID",nullable=false)
	public int getBranchId() {
		return this.branchId;
	}
	public void setBranchId(int branchId) {
		this.branchId = branchId;
	}

	@Column(name="PACKAGE_ID",nullable=false)
	public int getPackageId() {
		return this.packageId;
	}
	public void setPackageId(int packageId) {
		this.packageId = packageId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof WarehousePK)) {
			return false;
		}
		WarehousePK castOther = (WarehousePK)other;
		return 
			(this.branchId == castOther.branchId)
			&& (this.packageId == castOther.packageId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.branchId;
		hash = hash * prime + this.packageId;
		
		return hash;
    }
}